<!DOCTYPE html>
<html>
<head>
<title>KXD UI</title>  
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="expires" content="0">
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="cache-control" content="no-cache,no-store,max-age=0" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
  <script type="text/javascript">var contextPath='${request.contextPath}'</script>
  
  <!-- 处理黑框 -->

  
  <link rel="stylesheet" href="${request.contextPath}/lib/bootstrap/css/bootstrap.min.css">
  <link rel="stylesheet" href="${request.contextPath}/css/font-awesome.min.css">
  <link rel="stylesheet" href="${request.contextPath}/css/ionic.min.css">
  <link rel="stylesheet" href="${request.contextPath}/css/AdminLTE.min.css">
  <link rel="stylesheet" href="${request.contextPath}/css/skins/_all-skins.min.css"> 
  <link rel="stylesheet" href="${request.contextPath}/lib/plugins/artDialog/ui-dialog.css">
  <link rel="stylesheet" href="${request.contextPath}/css/index.css">
  <link rel="stylesheet" href="${request.contextPath}/lib/plugins/datepicker/datepicker3.css">
   
  
  <script src="${request.contextPath}/lib/plugins/jQuery/jQuery-2.1.4.min.js"></script>
  <script src="${request.contextPath}/lib/plugins/jQueryUI/jquery-ui.min.js"></script>
  <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
  <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
  <!--[if lt IE 9]>
  <script src="${request.contextPath}/lib/plugins/html5shiv/3.7.3/html5shiv.min.js"></script>
  <script src="${request.contextPath}/lib/plugins/respond/1.4.2/respond.min.js"></script>
  <![endif]-->  
  
  
  <!-- 陈兴斌样式，数据引用 -->
<link rel="stylesheet" href="${request.contextPath}/lib/plugins/datatables/dataTables.bootstrap.css">
<script src="${request.contextPath}/lib/plugins/datatables/jquery.dataTables.min.js"></script>
<script src="${request.contextPath}/lib/plugins/datatables/dataTables.buttons.js"></script>
<script src="${request.contextPath}/lib/plugins/datatables/dataTables.bootstrap.min.js"></script>
<script src="${request.contextPath}/lib/plugins/datatables/buttons.bootstrap.js"></script>
<!-- -------------------------------------------------------------------------------- -->




</head>
<body class="hold-transition skin-blue sidebar-mini ">
<div class="wrapper">

  <header class="main-header">
    <!-- Logo -->
    <a href="index.html" class="logo">     
      <span class="logo-mini"><b>KXD</b></span>      
      <span class="logo-lg"><b>KXD UI</b></span>
    </a>
    <!-- Header Navbar: style can be found in header.less -->
    <nav class="navbar navbar-static-top" role="navigation">
      <!-- Sidebar toggle button-->
      <a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button">
        <span class="sr-only">Toggle navigation</span>
      </a>

      <div class="navbar-custom-menu">
        <ul class="nav navbar-nav">
          <!-- Messages: style can be found in dropdown.less-->
          <li class="dropdown messages-menu">
            <a href="#" class="dropdown-toggle" data-toggle="dropdown">
              <i class="fa fa-envelope-o"></i>
              <span class="label label-success">4</span>
            </a>            
          </li>
          <!-- Notifications: style can be found in dropdown.less -->
          <li class="dropdown notifications-menu">
            <a href="#" class="dropdown-toggle" data-toggle="dropdown">
              <i class="fa fa-bell-o"></i>
              <span class="label label-warning">10</span>
            </a>            
          </li>
          <!-- Tasks: style can be found in dropdown.less -->
          <li class="dropdown tasks-menu">
            <a href="#" class="dropdown-toggle" data-toggle="dropdown">
              <i class="fa fa-flag-o"></i>
              <span class="label label-danger">9</span>
            </a>            
          </li>
          <!-- User Account: style can be found in dropdown.less -->
          <li class="dropdown user user-menu">
            <a href="#" class="dropdown-toggle" data-toggle="dropdown">
              <img src="${request.contextPath}/images/user2-160x160.jpg" class="user-image" alt="User Image">
              <span class="hidden-xs">${userInfo.nickName!}</span>
            </a>
            <ul class="dropdown-menu">
                  <!-- User image -->
                  <li class="user-header">
                    <img src="${request.contextPath}/images/user2-160x160.jpg" class="img-circle" alt="User Image" />
                    <p>
                      ${userInfo.nickName!}
                      <small>${userInfo.email!}</small>
                    </p>
                  </li>
                  <!-- Menu Body -->
                  <li class="user-body">
                    
                    <div class="col-xs-4 text-center" style="width: 100%;">
                      <button class="btn btn-primary margin btn-sm" type="button" onclick="showUser();">查看个人资料</button>
                    </div>
                  </li>
                  <!-- Menu Footer-->
                  <li class="user-footer">
                    <div class="pull-left">
                      <a href="#" class="btn btn-default btn-flat" onclick="showPassword()">修改密码</a>
                    </div>
                    <div class="pull-right">
                      <a href="#" onclick="Quit()" class="btn btn-default btn-flat">退出</a>
                    </div>
                  </li>
                </ul>
          </li>
          <!-- Control Sidebar Toggle Button -->
          <li>
            <a href="#" target="_top" ><i class="fa fa-gears"></i></a>
          </li>
        </ul>
      </div>
    </nav>
  </header>
  <!-- header end -->
  
  
  <!-- 查看用户资料 -->
  <div class="modal" id="updateUser" tabindex="-1" role="dialog" >
  <div class="modal-dialog" role="document"  style="margin-top:100px; ">
    <div class="modal-content" style="border-radius:10px">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel">个人资料</h4>
      </div>
      <div class="modal-body">
        	<div>
               <label for="exampleLoginName1" >姓名</label>
               <input type="text" class="form-control"  id="nickName" name="nickName" />              
            </div> 
            
            <div>
               <label for="exampleLoginName1" >邮箱</label>
               <input type="text" class="form-control"  id="email" name="email"  />              
            </div> 
            
              <div>
               <label for="exampleLoginName1" >电话</label>
               <input type="text" class="form-control"  id="phone" name="phone" />              
            </div>
            
            <div>
            <label for="exampleLoginName1" >生日</label>
                  <div class="input-group">
                      <span style="position: relative; z-index: 9999;">
                      	<input class="form_datetime form-control" style="z-index: 9999; " id="birthday" name="birthday" type="text" readonly>
                      </span>
                      <span class="input-group-addon">
                      	<i class="fa fa-calendar"></i>
                      </span>
                  </div>
              </div>
            
            
              
                <div>               
                  <label for="exampleNickname1">性别</label>
                   <select class="form-control" id="sex" name="sex" data-bv-field="country" >
  						<option value="0">男</option>
        				<option value="1">女</option>
   				   </select>
                </div>
              
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
      	<button type="button" class="btn btn-primary" onclick="updateUser()">保存</button>
      </div>
    </div>
  </div>
</div>


 <!-- 修改密码 -->
  <div class="modal" id="updateUserPassword" tabindex="-1" role="dialog" >
  <div class="modal-dialog" role="document"  style="margin-top:100px;">
    <div class="modal-content" style="border-radius:10px">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel">修改密码</h4>
      </div>
      <div class="modal-body">
        	<div>
               <label for="exampleLoginName1" >用户密码</label>
               <input type="password" class="form-control" id="usedpwd" name="usedpwd" placeholder="usedPassword"/>              
            </div> 
            <div>
               <label for="exampleLoginName1" >新密码</label>
               <input type="password" class="form-control" id="newpwd" name="newpwd" placeholder="newPassword"/>              
            </div>
            <div>
               <label for="exampleLoginName1" >确认密码</label>
               <input type="password" class="form-control" id="verifypwd" name="verifypwd" placeholder="verifyPassword"/>              
            </div>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
      	<button type="button" class="btn btn-primary" onclick="updateUserPassword()">保存</button>
      </div>
    </div>
  </div>
</div>
  
  

  <!-- Left side column. contains the logo and sidebar -->
  <aside class="main-sidebar">
    <!-- sidebar: style can be found in sidebar.less -->
    <section class="sidebar">
      <!-- Sidebar user panel -->
      <div class="user-panel">
        <div class="pull-left image">
          <img src="${request.contextPath}/images/user2-160x160.jpg" class="img-circle" alt="User Image">
        </div>
        <div class="pull-left info">
          <p>${userInfo.nickName!}</p>
          <a href="#"><i class="fa fa-circle text-success"></i>上次访问时间:${userInfo.lastLoginTime!}</a>
        </div>
      </div>
      <div class="menutool"><div class="refresh ion-ios-refresh-empty" id="menurefresh"></div></div>
      <!-- sidebar menu: -->      

    </section>
    <!-- /.sidebar -->
  </aside>
  <!-- leftside end  -->

  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header" id="content-header">
      <h1>
        Dashboard
        <small>Control panel</small>
      </h1>
      <ol class="breadcrumb">
        <li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
        <li class="active">Dashboard</li>
      </ol>
    </section>

    <!-- Main content -->
    <section class="content">
      <!-- Small boxes (Stat box) -->      
        

    </section>
    <!-- /.content -->
  </div>
  <!-- /.content-wrapper -->

  <footer class="main-footer">
    <div class="pull-right hidden-xs">
      <b>Version</b> 1.1.0
    </div>
    <strong>Copyright &copy; 2016-2017 <a href="#">KXD</a>.</strong> All rights
    reserved.
  </footer>
  
<!-- ./wrapper -->
<script type="text/javascript">
  $.widget.bridge('uibutton', $.ui.button);
  //$('#myModal').on('shown.bs.modal', function () {
	  //$('#myInput').focus()
	//})
	
	
	//打开用户详情
	function showUser() {
		var nickName="${userInfo.nickName!}";//昵称
		var email="${userInfo.email!}";//邮箱
		var phone="${userInfo.phone!}";//手机号码
		var birthday="${userInfo.birthday!}";//生日
		var sex= "${userInfo.sex!}";//性别
		$("#sex").val(sex);
		$("#nickName").val(nickName);
		$("#email").val(email);
		$("#phone").val(phone);
		$("#birthday").val(birthday);
		
		LoadDatepicker();
		
		$('#updateUser').modal('show');
			
	}
  
  
  	//保存
  	function updateUser(){
  		var data={nickName:$("#nickName").val(),sex:$("#sex").val(),email:$("#email").val(),phone:$("#phone").val(),birthday:$("#birthday").val()};
  		
  		 $.ajax({
      		url:contextPath+"/soa/manage/update",
      		data:data,
      		type:"post",
      		dataType:"json",
      		async:false,
      		success: function(result){
      			if(result.status==0){
      				var d = dialog({
      					zIndex:9999999,
           				content : result.msg
           			});
           			d.show();
           			setTimeout(function() {
           				d.close().remove();
           			}, 4000);
           			$('#updateUser').modal('hide');
      			}else if(result.status==1){
      				var d = dialog({
      					zIndex:9999999,
           				content : result.msg
           			});
           			d.show();
           			setTimeout(function() {
           				d.close().remove();
           			}, 4000);
      			}else if(result.status==2){
      				var d = dialog({
      					zIndex:9999999,
           				content : result.msg
           			});
           			d.show();
           			setTimeout(function() {
           				d.close().remove();
           			}, 4000);
      			}
      			
      		    },
      		error : function() {  
                  alert('修改失败!');
              } 
      		});
  		 
  	}
  	
  	
  	//打开修改密码框
  	function showPassword(){
  		$('#updateUserPassword').modal('show');
  	}
  	
  	//修改密码
  	function updateUserPassword(){
  		var data={usedpwd:$("#usedpwd").val(),newpwd:$("#newpwd").val(),verifypwd:$("#verifypwd").val()};
  		
 		 $.ajax({
     		url:contextPath+"/soa/manage/password/update",
     		data:data,
     		type:"post",
     		dataType:"json",
     		async:false,
     		success: function(result){
     			
     			if(result.status==0){
     				var d = dialog({
     					zIndex:9999999,
          				content : result.msg
          			});
          			d.show();
          			setTimeout(function() {
          				d.close().remove();
          			}, 4000);
          			
          			$('#updateUser').modal('hide');
          			
     			}else if(result.status==1){
     				var d = dialog({
     					zIndex:9999999,
          				content : result.msg
          			});
          			d.show();
          			setTimeout(function() {
          				d.close().remove();
          			}, 4000);
     			}else if(result.status==2){
     				var d = dialog({
     					zIndex:9999999,
          				content : result.msg
          			});
          			d.show();
          			setTimeout(function() {
          				d.close().remove();
          			}, 4000);
     			} 
     			
     		    },
     		error : function() {  
                 alert('修改失败!');
             } 
     		}); 
  	} 
  	
  	//退出登录
  	function Quit(){
  		var d = dialog({
            title:'提示',
            content:'你确定要退出系统吗？',
            okValue:'确认',
            ok:function(){
            	$.post(contextPath+"/logout", function(data) {
            		location.reload();
            		});
            },
            cancelValue:'取消',
            cancel:function(){}
  			
  		});
  		d.showModal(); 
  	}
  	
  	
  	//加载时间控件
  	function  LoadDatepicker(){
  		 $('.form_datetime').datepicker({
			  language:'zh-CN',
			  format: 'yyyy-mm-dd',
			  weekStart: 1,  
		      autoclose: true,  
		      forceParse: false 
			  
		  });
  	}
  	
	
</script>
<script src="${request.contextPath}/lib/bootstrap/js/bootstrap.min.js"></script>
<script src="${request.contextPath}/lib/plugins/datepicker/bootstrap-datepicker.js"></script>
<script src="${request.contextPath}/lib/plugins/datepicker/locales/bootstrap-datepicker.zh-CN.js"></script>
<script src="${request.contextPath}/js/app.js"></script>
<script src="${request.contextPath}/js/utils.js"></script>
<script src="${request.contextPath}/js/sidebar-menu.js"></script>
<script src="${request.contextPath}/lib/plugins/artDialog/dialog-min.js"></script>
<script type="text/javascript" src="http://webapi.amap.com/maps?v=1.3&key=e761e01ea7ca6cffbe3c1309ab451df2"></script>
</body>
</html>
